package com.jnu.keepaccounts.data;

import java.io.Serializable;
import java.util.ArrayList;

public class DataTou extends Data implements Serializable {
    private double shouru;
    private double zhichu;
    public DataTou(){}
    public DataTou(int x,int year,int month,int day ) {
        super(x,year,month,day,0);
    }
    public void cal (DataTiaoMu dataTiaoMu,int flag){
        double num = dataTiaoMu.getShuE();
        //1表示添加,-1表示删除
        if(num>0)shouru=shouru+num*flag;
        else zhichu=num*flag+zhichu;
    }
    public int getYear() {
        return super.getYear();
    }
    public int getMonth(){return super.getMonth();}
    public int getDay(){return super.getDay();}
    public double getShou() {
        return shouru;
    }
    public double getZhi() {
        return zhichu;
    }
    public void setShouru(double shouru){this.shouru = shouru;}
    public void setZhichu(double zhichu){this.zhichu = zhichu;}
    public void setYear(int year){super.setYear(year);}
    public void setMonth(int month){super.setMonth(month);}
    public void setDay(int day){super.setDay(day);}

    @Override
    public void setFlag(int flag) {
        super.setFlag(flag);
    }
    //    public void cal(){
//        for(DataTiaoMu dataTiaoMu:dataTiaoMus){
//            double tem_shuE = dataTiaoMu.getShuE();
//            if(tem_shuE>0){
//                shouru+=tem_shuE;
//            }
//            else zhichu+=tem_shuE;
//        }
//    }
}
